import {get, post, del, put } from './http.js'

const baseURL = ''

// 登录
export const login = params => { return post(`${baseURL}login`, params) }

// 获取个人信息
export const getUserInfo = params => { return get(`${baseURL}secondary/user/info`, params) }
    // 获取菜单列表
export const getMenuList = params => { return get(`${baseURL}menus`, params) }
    // --------------------------------- start User.vue -------------------------------
    //  一级账号修改二级用户信息
export const editUser = params => { return put(`${baseURL}supervisor/user/secondary`, params) }
    // 添加二级账号时检测 手机号以及用户名是否重复
export const addCheckUserRepetition = params => { return get(`${baseURL}supervisor/user/check/repetition`, params) }
    // 获取二级用户列表
export const getSecondaryList = params => { return get(`${baseURL}supervisor/user/secondary/list`, params) }
    // 开关二级用户
export const userStateChanged = params => { return put(`${baseURL}supervisor/user/secondary`, params) }
    // 增加二级用户
export const addSecondary = params => { return post(`${baseURL}supervisor/user/secondary`, params) }
    // 获取要修改二级用户信息
export const getSecondaryInfoById = params => { return get(`${baseURL}supervisor/user/secondary/id`, params) }

export const getUserLikeList = params => { return get(`${baseURL}supervisor/user/like/list`, params) }
    // --------------------------------- end User.vue -------------------------------

//---------------------------------- start Task.vue ------------------------------
// 一级用户删除任务
export const removeTaskById = params => { return put(`${baseURL}supervisor/task/put`, params) }
    //  获取要修改的任务信息
export const getPutTaskInfo = params => { return get(`${baseURL}secondary/task/id`, params) }
    // 新增任务
export const addTask = params => { return post(`${baseURL}supervisor/task/add`, params) }
    // 修改任务
export const putTask = params => { return put(`${baseURL}supervisor/task/put`, params) }
    // 一级用户获取任务列表
export const getSupervisoorTaskList = params => { return get(`${baseURL}supervisor/task/all`, params) }
    // 模糊查找
export const getTaskLikeList = params => { return get(`${baseURL}supervisor/task/like/list`, params) }

//---------------------------------- end Task.vue ------------------------------


//---------------------------------- start ChildTaskInfo.vue ------------------------------
// 对待审核任务 进行审核
export const auditSecondaryTask = params => { return post(`${baseURL}supervisor/task/finish`, params) }
    // 获取二级用户7天内的任务完成情况
export const getWithinTaskInfo = params => { return get(`${baseURL}supervisor/task/within/day`, params) }
    // 获取二级用户的待审核列表
export const getAuditTaskList = params => { return get(`${baseURL}supervisor/task/audit`, params) }
    // 获取二级账号的任务完成情况列表
export const supervisorGetSecondaryListTaskInfo = params => { return get(`${baseURL}supervisor/user/secondary/task`, params) }
    //---------------------------------- end ChildTaskInfo.vue ------------------------------

//---------------------------------- start SupervisorShop.vue ------------------------------
// 根据奖励id获取信息
export const getSupervisorShopId = params => { return get(`${baseURL}supervisor/shop/id`, params) }
    // 修改奖励信息
export const updateShop = params => { return put(`${baseURL}supervisor/shop/commodity`, params) }
    // 增加一个奖励
export const addShop = params => { return post(`${baseURL}supervisor/shop/commodity`, params) }
    // 一级用户获取奖励列表
export const getSupervisorShopList = params => { return get(`${baseURL}supervisor/shop/list`, params) }
    //---------------------------------- end SupervisorShop.vue ------------------------------
    //---------------------------------- start SupervisorEmail.vue ------------------------------
export const getEmailList = params => { return get(`${baseURL}secondary/message/email/list`, params) }

//---------------------------------- end SupervisorEmail.vue ------------------------------


//---------------------------------- start SupervisorCommitmentShop.vue ------------------------------
export const getSupervisorCommitmentList = params => { return get(`${baseURL}supervisor/commitment/list`, params) }
export const fulfillCommitment = params => { return put(`${baseURL}supervisor/commitment/fulfill`, params) }